package com.thermofisher.dsc.amanda.common.receiveFile.service.impl;

import com.thermofisher.dsc.amanda.common.Query;
import com.thermofisher.dsc.amanda.common.crud.Util;
import com.thermofisher.dsc.amanda.common.crud.service.AbsBaseService;
import com.thermofisher.dsc.amanda.common.receiveFile.mapper.ReceiveFileMapper;
import com.thermofisher.dsc.amanda.common.receiveFile.service.ReceiveFileService;
import com.thermofisher.dsc.amanda.common.util.SessionUtil;
import com.thermofisher.dsc.amanda.customer.mapper.CustomerMapper;
import com.thermofisher.dsc.amanda.customer.mapper.ITSCARMapper;
import com.thermofisher.dsc.amanda.customer.service.CustomerService;
import com.thermofisher.dsc.amanda.model.dto.customer.CustomerDto;
import com.thermofisher.dsc.amanda.model.dto.receiveFile.ReceiveFileDto;
import com.thermofisher.dsc.amanda.model.po.customer.Customer;
import com.thermofisher.dsc.amanda.model.po.receiveFile.ReceiveFile;
import com.thermofisher.dsc.amanda.model.response.PageResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by wenjie.yang on 1/3/2019.
 */
@Service
public class ReceiveFileServiceImpl extends
        AbsBaseService<ReceiveFileDto, ReceiveFile, ReceiveFileMapper> implements ReceiveFileService {

    private static final List<String>
            DEPARTMENT = Arrays.asList("BID", "LSC", "BPD", "Other");

    /**
     * 默认构造函数
     */
    public ReceiveFileServiceImpl(ReceiveFileMapper mapper) {
        super(mapper);
    }

    @Autowired
    private ReceiveFileMapper receiveFileMapper;

    @Override
    public ReceiveFileDto getLastedOne(Integer fileCategroy) {
        ReceiveFile lastedOne = receiveFileMapper.getLastedOne(1);
        if (lastedOne != null){
            ReceiveFileDto receiveFileDto = new ReceiveFileDto();
            BeanUtils.copyProperties(lastedOne, receiveFileDto);
            return receiveFileDto;
        }
        return null;
    }
}
